<?php
$alias = preg_replace("/(.html)/",'', $this->security->xss_clean($this->uri->segment(2,0)));
$checkhoanthanh = $this->common_model->getone('users',array('id'=>$this->session->userdata('id')),array('id','buoc1','buoc2','buoc3','buoc4'));
$next = '';
$active5 ='';
$active1 ='';
$active2 ='';
$active3 ='';
$active4 ='';
$hoanthanh1 ='';
$hoanthanh2 ='';
$hoanthanh3 ='';
$hoanthanh4 ='';
$hoanthanh5 ='';
if($alias == 'buoc1')
    {
        $next = 'dang-ky/buoc2';
        $active1 = 'active_step';
    }
    elseif($alias == 'buoc2')
    {
            $next = 'dang-ky/buoc3';
            $active2 = 'active_step';
    }
    elseif($alias == 'buoc3')
    {
            $next = 'dang-ky/buoc4';
            $active3 = 'active_step';
    }
    elseif($alias == 'buoc4')
    {
            $next = 'dang-ky/buoc5';
            $active4 = 'active_step';
    }
    elseif($alias == 'buoc5')
    {
            $active5 = 'active_step';
    }
if ($checkhoanthanh->buoc1 == 1)
    {
        $hoanthanh1 ='hoanthanh';
    }
if ($checkhoanthanh->buoc2 == 1)
    {
        $hoanthanh2 ='hoanthanh';
    }
if ($checkhoanthanh->buoc3 == 1)
    {
        $hoanthanh3 ='hoanthanh';
    }
if ($checkhoanthanh->buoc4 == 1)
    {
        $hoanthanh4 ='hoanthanh';
    }
 ?>
<div class="main_step">
  <p class="main_step1">Các bước để trở thành gia sư</p>
    <ul id="main_step2" class="clearfix">
        <li class="step nhay <?php echo $active1.' '.$hoanthanh1; ?>">
          <a href="javascript://" rel="<?php echo base_url().'dang-ky/buoc1';?>">
            <h2 class="num_step">1</h2>
            <p class="name_step">Chọn môn học<?php if($hoanthanh1 !=''){echo '<i style="margin-left:5px;color:green;" class="icon-check-sign"></i>';} ?></p>
          </a>
        </li>

         <li class="step nhay <?php echo $active2.' '.$hoanthanh2; ?>">
          <a href="javascript://" rel="<?php echo base_url().'dang-ky/buoc2';?>">
            <h2 class="num_step">2</h2>
            <p class="name_step">Thông tin cá nhân<?php if($hoanthanh2 !=''){echo '<i style="margin-left:5px;color:green;" class="icon-check-sign"></i>';} ?></p>
          </a>
        </li>
         <li class="step nhay <?php echo $active3.' '.$hoanthanh3; ?>">
          <a href="javascript://" rel="<?php echo base_url().'dang-ky/buoc3';?>">
            <h2 class="num_step">3</h2>
            <p class="name_step">Tiêu đề - Tự thuật<?php if($hoanthanh3 !=''){echo '<i style="margin-left:5px;color:green;" class="icon-check-sign-sign"></i>';} ?></p>
          </a>
        </li>
         <li class="step nhay <?php echo $active4.' '.$hoanthanh4; ?>">
          <a href="javascript://" rel="<?php echo base_url().'dang-ky/buoc4';?>">
            <h2 class="num_step">4</h2>
            <p class="name_step">Hoàn thành đăng ký</p>
          </a>
        </li>
    </ul>
    <!-- /#main_step2 -->
</div>
<div class="popnext">
    <ul>
        <li><a href="javascript://" class="close">Tiếp tục đăng ký</a></li>
        <li><a href="javascript://" id="nhaybuoc" title="Bước tiếp theo">Đến bước này</a></li>
    </ul>
</div>
<script>
    $(document).ready(function(){
            $('.hoanthanh').removeClass('nhay');
            $('#main_step2 .nhay a').click(function(){
                $('.overlay').fadeIn();
                var link = $(this).attr('rel');
                $('.popnext').toggle(400);
                $('#nhaybuoc').click(function()
                    {
                        location.assign(link);
                    });
            });
            $('.close').click(function(){
               $('.overlay').fadeOut();
               $('.popnext').fadeOut();
               link = '';
            });
    });
</script>
<style>
.hoanthanh
{
    background:#D6F0B4;
}
</style>